/****************************************************************************************
* Title: TESTE YAM-MEMORY
*****************************************************************************************
* File: tb_add2.go
* Authors: Joao Leonardo Fragoso, Luciana Mendes, Gisell Moura
* Company: UERGS - Unidade Guaiba
* Creation: 2013-01-29
*****************************************************************************************
* Description: GO Model for YGO Project ALU Module
*****************************************************************************************
* (c) 2012 UERGS - Joao Leonardo Fragoso
*****************************************************************************************
* Revision History
* Date        Author   Description
* 2013-02-26  Luciana  Creation
*****************************************************************************************
*/

// teste do yam com a instrução ADD

package main

import (
  "ygo"
  "fmt"
)


func main() {

	load := make(chan int32)
	instruction_address := make(chan uint32)
	instruction := make(chan uint32)
	end := make(chan int32)
	ls_addr := make(chan uint32)
	ls_rw := make(chan bool)
	ls_data_in := make(chan int32)
	ls_data_out := make(chan int32)



	go ygo.Memory(load, instruction_address, instruction, ls_addr, ls_rw, ls_data_in, ls_data_out)
	go ygo.Yam(instruction_address,instruction, ls_addr, ls_rw, ls_data_in, ls_data_out)

	fmt.Println("[TB ] Sending data to memory")

	//for i:=0; i<4096; i++{
	for i:=0; i<10; i++{
		load <- 98336
	}

	fmt.Println("[TB ] Closing memory")
	close(load)

	fmt.Println("[TB ] Infinite loop")
	for {
		<- end
	} 

}
